/*
 * @Author: xushuhao
 * @Email: xshmouse@163.com
 * @Date: 2020-06-12 14:48:36
 * @Last Modified by: xushuhao
 * @Last Modified time: 2020-06-17 13:51:50
 * @Description: Description
 */

import 'dart:io';

import 'package:dio/dio.dart';
import 'package:flutter/material.dart';

/// 公共接口相关
class ReqCommon {
  final Dio _dio;

  ReqCommon(this._dio);

  //单图片上传
  Future<Response> updateImage(String path) async {
    return await _dio.post(
      "/common/imageUpload",
      data: FormData.fromMap({
        "file": await MultipartFile.fromFile(path, filename: "imagefilename"),
      }),
      // onSendProgress: (received, total) {
      //   if (total != -1) {
      //     print((received / total * 100).toStringAsFixed(0) + "%");
      //   }
      // },
    );
  }

  //教师职称列表
  Future<Response> getJobTitlelist() {
    return _dio.get('/common/getTeacherJobTitleList');
  }


  
}
